<?php

namespace App\Http\Controllers;

use Illuminate\Routing\Controller as BaseController;

class TestController extends BaseController
{
	public function index()
	{
		$file = 'test.vbs';

		$title = iconv("UTF-8", "GBK//IGNORE", '哈哈哈哈');
		$content = iconv("UTF-8", "GBK//IGNORE", '哈哈哈哈哈哈哈哈哈哈哈哈');

		$site[] = 'x=msgbox("'.$content.'",0,"'.$title.'")';
		$site[] = 'x=msgbox("'.$content.'",0,"'.$title.'")';

		$site = implode(PHP_EOL,$site);

		file_put_contents($file, $site, LOCK_EX);

		$command = ".\\".$file;

		exec($command, $output, $return);

		var_dump($output,$return);

		echo 'end';
	}
}